//
//  CCVSColumn.h
//  CollectionViewTest
//
//  Created by Pasirstein, David B on 5/11/13.
//  Copyright (c) 2013 Pasirstein, David B. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface CCVSColumn : NSObject


/////////////
//
// studySections is an array of NSString where the first item
// is the top level title and other items represent section headers
// the number of items in this array represent the number of sections
// there must be at least 1 item.
//
// topics and details represent the left and right side of the display
// their items must match to the studySection.  For example, topic[1] will
// contain a (sub) NSArray for the topics in studySection[1]
// topics and details sub-arrays MUST be equal count!
// while details can be intermixed of NSArray or a few other objects.  In cases
// where details contains an NSArray object as one of the elements,
// that array subelement must be of size 2 where it assumes the first
// is an NSArray of sub-topics and the second is an NSArray of sub-details
// -similar to the top level except the left and right are within the
// higherlevel right detail view.
// - it should be possible to have even deeper levels of code
//
// Topics and Details have native support for NSStrings; however, other
// custom types may be added by implementing the type protocols in
// CCVSCustomTypes.h.  Included examples: DATA Types of
// CCVSHyperLink and CCVSImage  and VIEW Types of CCVSExtendedLabel
// and CCVSExtendedImageView
//
// With the protocols implemented, you can add objects of those
// DATA TYPES to the Topics and Details array...
//


//setting the width to an absolute value
//will invalidate percentWidthOfSuperView
//this value does not need to be set; however, if
//it is set, it will be used either as an absolute value
//when displayed with the as a FULL SCALE layout
//or proportional if it is a SCALE to SUPERVIEW
@property (nonatomic) CGFloat width;
//setting percentWidthOfSuperView will invalidate width
//it is set, it will be used either as an absolute value
//when displayed with the as a FULL SCALE layout
//or proportional if it is a SCALE to SUPERVIEW
//the percent should be set in decimal form
//e.g., 20% should be set as 0.2
@property (nonatomic) CGFloat percentWidthOfSuperView;
@property (readonly,nonatomic) int numberOfSections;

-(int)getNumberOfSectionsFilterEmptySections:(BOOL)filter;

-(void)addSection:(NSString*)title withTopics:(NSArray*)topics withDetails:(NSArray*)details; //ccvs custom data or NSStrings

-(void)addSectionAtIndex:(int)section withTitle:(NSString*)title withTopics:(NSArray*)topics withDetails:(NSArray*)details; //ccvs custom data or NSStrings
-(void)removeSetion:(int)section;


-(NSString*)titleOfSection:(int)section;
-(NSString*)titleOfSection:(int)section filterEmptySections:(BOOL)filter;
-(NSArray*)topicDataInSection:(int)section;
-(NSArray*)topicDataInSection:(int)section filterEmptySections:(BOOL)filter;
-(NSArray*)detailDataInSection:(int)section;
-(NSArray*)detailDataInSection:(int)section filterEmptySections:(BOOL)filter;

-(NSArray*)getSections;
-(NSArray*)getSectionsFilterEmptySections:(BOOL)filter;

//Future
//note: subcolumns have limitations. inc: no sections only the first section,
//title must be non-nil, but title will not be display.  currently, subsections
//must be an array of exactly 2 column objects, although they can each contain
//subsections with the same limitations
//-(void)addSectionWithSubColumns:(NSString*)title withSubColumns:(NSArray*)ccvsColumns;
//-(BOOL)doesSectionContainSubColumns:(int)section;

@end
